<template>
    <example :template-code="templateString">
        <template #describe>
            <t :id="`${$t('启用筛选')}`">{{ $t('启用筛选') }}</t>
            <li>
                配置<span class="d-code">filterable</span>为<span class="s-code">true</span>即可启用选项过滤功能
            </li>
        </template>
        <div style="width: 300px;color:#666;">
            <sib-item v-model="value" :props="props"></sib-item>
        </div>
        <div style="color:#666;">
            <p>v-model 绑定值：{{ value }}</p>
        </div>
    </example>
</template>

<script>
import { ref, reactive } from 'vue';

export default {
    setup() {
        const value = ref(null);
        const props = reactive({
            type: 'select',
            filterable: true,
            options: Array(100).fill().map((_, i) => ({ label: `选项${i}`, value: i })),
        });

        return {
            props,
            value,
            templateString: `<template>
    <sib-item v-model="value" :props="props"></sib-item>
    <p>v-model 绑定值：{{ value }}</p>
</template>

<script>
import { ref, reactive } from 'vue';

export default {
    setup() {
        const value = ref(null);
        const props = reactive({
            type: 'select',
            filterable: true,
            options: Array(100).fill().map((_, i) => ({ value: i, label: \`选项\${i}\` })),
        });

        return { props, value };
    },
};
<\/script>`,
        };
    },
};
</script>
